#include "main.h"
#include "pthread.h"
#include <unistd.h>
#include <stdio.h>


int main()
{
	pthread_t id;
	int ret;
	ret = pthread_create(&id, NULL, thread, NULL);
	if(ret != 0){
		printf("thread create failed with error : %d\n", ret);
	} else {
		for (int i = 0; i < 5; ++i)
		{
			printf("This is main progress , number is : %d\n", i);
			sleep(1);
		}
		pthread_join(id, NULL);
	}

	return 0;
}

void *thread(void *ptr)
{
	int i;
	for(i = 0;i<10;i++){
		printf("This is pthread , number is : %d\n", i);
		sleep(1);
	}
	return 0;
}